package com.shop.shoppingmall.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * (ShMerchant)实体类
 *
 * @author makejava
 * @since 2020-09-09 14:53:50
 */
@Data
public class ShMerchant implements Serializable {
    private static final long serialVersionUID = 782229535153494020L;
    /**
     * 主键
     */
    private String id;
    /**
     * 用户id
     */
    @NotBlank(message = "用户id不能为空")
    private String userId;
    /**
     * 商户名称
     */
    @NotBlank(message = "店铺名称不能为空")
    private String merchantName;
    /**
     * 头像
     */
    private String merchantPhoto;
    /**
     * 证照信息
     */
    @NotBlank(message = "证照信息不能为空")
    private String license;
    /**
     * 店铺简介
     */
    @NotBlank(message = "店铺简介不能为空")
    private String brief;
    /**
     * 所在地区
     */
    @NotBlank(message = "所在地区不能为空")
    private String location;
    /**
     * 销售品牌
     */
    @NotBlank(message = "销售品牌不能为空")
    private String brand;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    private Date creatTime;
    /**
     * 更新时间0
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    private Date updateTime;

    private String followState;
    private String shopNums;
    private List<ShProduct> productList;

    private String flag;
    private Integer total;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    public String getMerchantPhoto() {
        return merchantPhoto;
    }

    public void setMerchantPhoto(String merchantPhoto) {
        this.merchantPhoto = merchantPhoto;
    }

    public String getLicense() {
        return license;
    }

    public void setLicense(String license) {
        this.license = license;
    }

    public String getBrief() {
        return brief;
    }

    public void setBrief(String brief) {
        this.brief = brief;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public Date getCreatTime() {
        return creatTime;
    }

    public void setCreatTime(Date creatTime) {
        this.creatTime = creatTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getFlag() {
        if("".equals(flag)||flag==null){
            return "1";//去除该属性的前后空格并进行非空非null判断
        }
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag == null ? null : flag.trim();
    }



}
